﻿using CCManger.WinServer.ViewModels;
using CCManger.WinServer.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Mvvm;
using System.Windows;

namespace CCManger.WinServer
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //注册导航菜单
            //containerRegistry.RegisterForNavigation<Server>();
            //containerRegistry.RegisterForNavigation<About>();
        }

        /// <summary>
        /// 配置模块
        /// </summary>
        /// <param name="moduleCatalog"></param>
        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<CCManger.ModuleSocket.ModuleSocketModule>();
        }

        /// <summary>
        /// 手动配置 viewModel
        /// </summary>
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();
            ViewModelLocationProvider.Register<LeftRegion, MainWindowViewModel>();
        }
    }
}